package com.thysdy.flowable.exception;

import com.thysdy.flowable.enums.CodeEnum;
import lombok.Data;

@Data
public class MyException extends RuntimeException {
    private CodeEnum codeEnum;
    private int code;
    private String message;

    public MyException(CodeEnum codeEnum) {
        this.codeEnum = codeEnum;
        this.code=codeEnum.getCode();
        this.message=codeEnum.getMessage();
    }

    public MyException(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
